/**
  ******************************************************************************
  * @file    WinCommThread.h
  * @brief   head file for whirlpool win thread
  * @author  wf.chen[wf.chen@signway.cn]
  * @version V1.0.0
  * @date    2020/03/09
  ******************************************************************************
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * COPYRIGHT 2020 Signway NanJing Ltd.
  *
  ******************************************************************************
  */

#ifndef CPP_THREADING_H_
#define CPP_THREADING_H_

#include <queue>
#include <thread>

//< Simplistic portable thread class.  Shutdown signalling left to derived class
class Thread
{
private:
    std::queue<std::thread> threads;
public:
    Thread();
    virtual ~Thread();
    //< Derived class must implement ThreadMain.
    virtual void threadMain(){}
    virtual void threadMain(uint32_t data){}
    //< Returns true if thread was successfully created
    // bool start(bool detach = true);
    bool start(uint32_t data = 0, bool detach = true);
    void stop();
};
#endif

